package inner;

public class LocalInnerClassDemo {
    LocalInnerClassDemo() {
        System.out.println("Test的构造方法..");
    }

    public static void main(String[] args) {
        int number = 100;  //number已经默认被声明为final,等同于 final int number = 100;
        class InnerClass {
            InnerClass() {
                System.out.println("InnerClass构造方法...");
            }

            public void fn() {
                //System.out.println(number++); //错误，因为number是final的,不能修改.
                System.out.println(number);
            }
        }

        InnerClass inner = new InnerClass();
        inner.fn();
    }
}
